/**
 * @ author: 汪孟苹
 */
define(["jquery","oms_config/root"],function($,$root){
	var error = {};

    /* ajax请求出错时的统一处理 */
    error.handle = function(status,msg,callback,time) {
        time = time ? time : 3500;
        switch (status) {
            /*case 0:
                callback("网络连接异常，请检查您的网络！",time);
                break;*/
            case 302:
                var config = $root.init();
                window.location.href = config.route.login;
                break;
            case 404:
                callback("您请求的服务不存在！",time);
                break;
            case 500:
                callback(msg,time);
                break;
            default:
                break;
        }
    };
    
	return error;
});